<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Users</title>
</head>
<body>
	<jsp:include page="/resources/templates/top.jsp" />
	<jsp:include page="/administration/templates/template?id=1" />
	<center>
		<form:form method="POST" action="deletegroup" commandName="checkedUsersList">
			<table border="1">
				<tr align="center">
					<td colspan="7">Users</td>
				</tr>
				<tr align="center">
					<td>&nbsp;</td>
					<td>id</td>
					<td>login</td>
					<td>password</td>
					<td>type</td>
					<td>edit</td>
					<td>delete</td>
				</tr>
				<c:if test="${!empty checkedUsersList}">
					<c:forEach items="${checkedUsersList.list}" var="i" varStatus="status">
						<form:hidden path="list[${status.index}].user.id"/>
						<tr align="center">
							<td><form:checkbox path="list[${status.index}].checked" /></td>
							<td>${i.user.id}</td>
							<td>${i.user.login}</td>
							<td>${i.user.password}</td>
							<td><a
								href="<c:url value="filter?user_type_id=${i.user.userType.id}" />">
									${i.user.userType.type} </a></td>
							<td><a href="<c:url value="edit?user_id=${i.user.id}" />"><img
									alt="edit" src="<c:url value='/resources/edit.png' />"></a></td>
							<td><a href="<c:url value="delete?user_id=${i.user.id}" />"><img
									alt="delete" src="<c:url value='/resources/delete.png' />"></a></td>
						</tr>
					</c:forEach>
				</c:if>
			</table>
			<p>
				<a href="<c:url value="add" />">Add</a><br>
				<input type="submit" value="Delete group">
			</p>
		</form:form>
	</center>
</body>
</html>